package model;

import model.enums.OrderStatus;

import java.time.LocalDateTime;
import java.util.List;

// 订单类
public class Order {
    private String orderId;
    //包含商品
    private List<Item> items;
    //状态
    private OrderStatus status;
    //总价
    private double totalPrice;
    //订单创建时间
    private LocalDateTime createTime;
    //用户是否为VIP
    private boolean isVIP;
    // 构造方法/getter/setter


    public Order(String orderId, List<Item> items, OrderStatus status, double totalPrice, LocalDateTime createTime, boolean isVIP) {
        this.orderId = orderId;
        this.items = items;
        this.status = status;
        this.totalPrice = totalPrice;
        this.createTime = createTime;
        this.isVIP = isVIP;
    }

    public boolean getisVIP() {
        return isVIP;
    }

    public void setVIP(boolean VIP) {
        isVIP = VIP;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public List<Item> getItems() {
        return items;
    }

    public void setItems(List<Item> items) {
        this.items = items;
    }

    public OrderStatus getStatus() {
        return status;
    }

    public void setStatus(OrderStatus status) {
        this.status = status;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId='" + orderId + '\'' +
                ", items=" + items +
                ", status=" + status +
                ", totalPrice=" + totalPrice +
                ", createTime=" + createTime +
                '}';
    }
}